package com.q3d.demo.svc.hello.mybatis.mapper;

import com.q3d.demo.svc.hello.mybatis.model.HelloWorldModel;
import com.q3d.demo.svc.hello.mybatis.model.HelloWorldModelExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectKey;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

public interface HelloWorldModelMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table t_hello_world
     *
     * @mbg.generated
     */
    @SelectProvider(type=HelloWorldModelSqlProvider.class, method="countByExample")
    long countByExample(HelloWorldModelExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table t_hello_world
     *
     * @mbg.generated
     */
    @DeleteProvider(type=HelloWorldModelSqlProvider.class, method="deleteByExample")
    int deleteByExample(HelloWorldModelExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table t_hello_world
     *
     * @mbg.generated
     */
    @Delete({
        "delete from t_hello_world",
        "where id = #{id,jdbcType=BIGINT}"
    })
    int deleteByPrimaryKey(Long id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table t_hello_world
     *
     * @mbg.generated
     */
    @Insert({
        "insert into t_hello_world (uuid, active, ",
        "world_name, world_desc, ",
        "world_age, world_radius, ",
        "world_weight, create_time)",
        "values (#{uuid,jdbcType=CHAR}, #{active,jdbcType=SMALLINT}, ",
        "#{worldName,jdbcType=VARCHAR}, #{worldDesc,jdbcType=VARCHAR}, ",
        "#{worldAge,jdbcType=INTEGER}, #{worldRadius,jdbcType=REAL}, ",
        "#{worldWeight,jdbcType=DOUBLE}, #{createTime,jdbcType=TIMESTAMP})"
    })
    @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="id", before=false, resultType=Long.class)
    int insert(HelloWorldModel row);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table t_hello_world
     *
     * @mbg.generated
     */
    @InsertProvider(type=HelloWorldModelSqlProvider.class, method="insertSelective")
    @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="id", before=false, resultType=Long.class)
    int insertSelective(HelloWorldModel row);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table t_hello_world
     *
     * @mbg.generated
     */
    @SelectProvider(type=HelloWorldModelSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="uuid", property="uuid", jdbcType=JdbcType.CHAR),
        @Result(column="active", property="active", jdbcType=JdbcType.SMALLINT),
        @Result(column="world_name", property="worldName", jdbcType=JdbcType.VARCHAR),
        @Result(column="world_desc", property="worldDesc", jdbcType=JdbcType.VARCHAR),
        @Result(column="world_age", property="worldAge", jdbcType=JdbcType.INTEGER),
        @Result(column="world_radius", property="worldRadius", jdbcType=JdbcType.REAL),
        @Result(column="world_weight", property="worldWeight", jdbcType=JdbcType.DOUBLE),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP)
    })
    List<HelloWorldModel> selectByExample(HelloWorldModelExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table t_hello_world
     *
     * @mbg.generated
     */
    @Select({
        "select",
        "id, uuid, active, world_name, world_desc, world_age, world_radius, world_weight, ",
        "create_time",
        "from t_hello_world",
        "where id = #{id,jdbcType=BIGINT}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="uuid", property="uuid", jdbcType=JdbcType.CHAR),
        @Result(column="active", property="active", jdbcType=JdbcType.SMALLINT),
        @Result(column="world_name", property="worldName", jdbcType=JdbcType.VARCHAR),
        @Result(column="world_desc", property="worldDesc", jdbcType=JdbcType.VARCHAR),
        @Result(column="world_age", property="worldAge", jdbcType=JdbcType.INTEGER),
        @Result(column="world_radius", property="worldRadius", jdbcType=JdbcType.REAL),
        @Result(column="world_weight", property="worldWeight", jdbcType=JdbcType.DOUBLE),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP)
    })
    HelloWorldModel selectByPrimaryKey(Long id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table t_hello_world
     *
     * @mbg.generated
     */
    @UpdateProvider(type=HelloWorldModelSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("row") HelloWorldModel row, @Param("example") HelloWorldModelExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table t_hello_world
     *
     * @mbg.generated
     */
    @UpdateProvider(type=HelloWorldModelSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("row") HelloWorldModel row, @Param("example") HelloWorldModelExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table t_hello_world
     *
     * @mbg.generated
     */
    @UpdateProvider(type=HelloWorldModelSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(HelloWorldModel row);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table t_hello_world
     *
     * @mbg.generated
     */
    @Update({
        "update t_hello_world",
        "set uuid = #{uuid,jdbcType=CHAR},",
          "active = #{active,jdbcType=SMALLINT},",
          "world_name = #{worldName,jdbcType=VARCHAR},",
          "world_desc = #{worldDesc,jdbcType=VARCHAR},",
          "world_age = #{worldAge,jdbcType=INTEGER},",
          "world_radius = #{worldRadius,jdbcType=REAL},",
          "world_weight = #{worldWeight,jdbcType=DOUBLE},",
          "create_time = #{createTime,jdbcType=TIMESTAMP}",
        "where id = #{id,jdbcType=BIGINT}"
    })
    int updateByPrimaryKey(HelloWorldModel row);
}